---
title: "SQL-042: Update remaining payment count on a benefit payment (twin class)"
summary: Update remaining payment count on a benefit payment (twin class)
status: draft
owner: SAIF Documentation Generator
last_reviewed: 2026-08-21
library: SAIF.Business.Claim
reference_type: embedded
---

# SQL-042 Update remaining payment count on a benefit payment (twin class)

Sets the remaining-payment count on a benefit payment during stop processing; identical logic to `clsActiveBenefitSchedule`.*

## Classification



| Field | Value |
| --- | --- |
| **SQL ID** | SQL-042 |
| **Operation type** | Update |
| **Execution method** | Inline SQL |
| **Database** | Oracle |
| **Schema** | `[unqualified]**` |
| **Command type** | Text |
| **Business object** | `clsBenefitSchedule` |
| **Criteria property** | `UpdateSchedSQL` |
| **Lifecycle method** | `ProcessBenefitPayment` |

## Parameters



| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `RemainingPaymentCount` | Input | Decimal | — | Forced to 1 for released scheduled payments |
| `ClaimID` | Input | Decimal | — | Row key |
| `BenefitPaymentSeqNum` | Input | Decimal | — | Row key |

## Tables



| Table | Access | Columns used |
| --- | --- | --- |
| [CL_BENEFIT_PAYMENT](../database-tables.md#cl_benefit_payment) | UPDATE | REMAINING_PAYMENT_COUNT, CLAIM_ID, BENEFIT_PAYMENT_SEQ_NUM |

## Sample SQL

```sql
-- Update remaining payment count
Update CL_BENEFIT_PAYMENT
   Set REMAINING_PAYMENT_COUNT = :RemainingPaymentCount
 Where CLAIM_ID                = :ClaimID
   And BENEFIT_PAYMENT_SEQ_NUM = :BenefitPaymentSeqNum
```

## Business rules

- [BR-009: Benefit schedule update must affect a row](../business-rules.md#br-009-benefit-schedule-update-must-affect-a-row)

## Sources
- SAIF.Business.Claim/clsBenefitSchedule.vb (not compiled)
